#include <cstdio>

int main()
{
	int n;
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		int a, b, c, d;
		scanf("%d%d%d%d", &a, &b, &c, &d);
		bool yes = true;
		if (a + b + c + d < 80) yes = false;
		if (yes) printf("Yes\n");
		else printf("No\n");
	}
}

